<?php 
namespace app\index\controller;
use think\Controller;
use think\Db;

class Common extends Controller{
    public function __construct()
    {
        parent::__construct();
        $this->header();
    }

    public function header(){
        $nav = Db::name('nav')->where('sid', 0)->select();
        $friends = Db::name('friends')->select();
        $config = Db::name('config')->select();
 
        $data = [
            'nav' => $nav,
            'friends' => $friends,
            'config' => $config,
        ];

        $this->assign('data', $data);
    }
}